/**
 * Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.cms.theme.entity;


import com.jeeplus.cms.support.validation.PatternExtend;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.core.persistence.DataEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;

/**
 * 主题Entity
 *
 * @author Sawyer
 * @version 2020-11-21
 */
@Getter
@Setter
@ToString
public class CmsThemes extends DataEntity<CmsThemes> {

    private static final long serialVersionUID = 1L;

    @Length(min = 1, max = 60, message = "主题名称长度必须介于 1 和 60 之间")
    @ExcelField(title = "主题名称", align = 2, sort = 1)
    private String name;

    @PatternExtend(regexp = "^[a-zA-Z]{1,60}$", required = true, message = "英文名称应为1-60个字符")
    @ExcelField(title = "英文名称", align = 2, sort = 2)
    private String enname;

    @ExcelField(title = "样式", align = 2, sort = 3)
    @PatternExtend(regexp = "^.{1,60}$", message = "样式名最大长度不能超过60")
    private String style;

    @PatternExtend(regexp = "^[0-1]$", required = true, message = "标记无效")
    @ExcelField(title = "激活状态", align = 2, sort = 4)
    private String activa;

    @ExcelField(title = "参数配置", align = 2, sort = 5)
    @PatternExtend(regexp = "^.{1,3000}$", message = "参数配置最大长度不能超过3000")
    private String paramConfig;

    public CmsThemes() {
        super();
        this.setIdType(IDTYPE_AUTO);
    }

    public CmsThemes(String id) {
        super(id);
    }

    public CmsThemes(String id, String name) {
        this.setId(id);
        this.name = name;
    }
}
